<template>
	<view class="grow-up">
		<u-card v-for="item in growUpList" @click="cardClick(item)" :title="item.title" :sub-title="item.createdByRealname">
			<view class="" slot="body" >
				<view class="u-body-item u-flex u-border-bottom u-col-between u-p-t-0">
					<view class="u-body-item-title u-line-2">{{item.introduction}}</view>
					<image :src="item.preview" mode="aspectFill"></image>
				</view>
			</view>
			<!-- <view class="" slot="foot"><u-icon name="eye" size="34" color="" label="33"></u-icon></view> -->
		</u-card>
	</view>
</template>

<script>
	import * as that from '@/API/index.js'
	export default {
		components:{
		},
		props:{
			id:{
				type:String,
				default:''
			}
		},
		data() {
			return {
				growUpList:[],
				title: '素胚勾勒出青花，笔锋浓转淡',
				subTitle: '2020-05-15',
				// thumb: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg',
			}
		},
		mounted() {
			this.getList()
		},
		methods: {
			getList(){
				let item = {
					page:1,
					limit:99,
					ExperimentInfoId:this.id
				}
				that.growPerceptionQuery(item).then(res =>{
					console.log('成长感悟数据')
					console.log(res.data)
					this.growUpList = res.data
				})
			},
			cardClick(item){
				if(item.href){
					uni.navigateTo({
						url:'../webView/webView?url='+item.href
					})
					return
				}
				let id  = ''
				let type = ''
				if(item.resourceId){
					id = item.resourceId
					type = '1'
				}
				if(item.rongHeJYInfoId){
					id = item.rongHeJYInfoId
					type ='2'
				}
				if(!id){
					uni.showToast({
						title:'没有资源Id'
					})
					return
				}
				uni.navigateTo({
					url:'../resource-detail/resource-detail?id=' + id + '&type=' + type
				})
			}
		}
	}
</script>


<style scoped lang="scss">
	.grow-up{
		height: 100%;
		overflow-y: auto;
	}
	.u-card-wrap { 
		background-color: $u-bg-color;
		padding: 1px;
	}
	
	.u-body-item {
		font-size: 32rpx;
		color: #333;
		padding: 20rpx 10rpx;
	}
		
	.u-body-item image {
		width: 120rpx;
		flex: 0 0 120rpx;
		height: 120rpx;
		border-radius: 8rpx;
		margin-left: 12rpx;
	}
</style>
